package com.zmj.sy.mom.srv.aps.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmj.sy.mom.srv.aps.bean.entity.base.UserMessage;
import com.zmj.sy.mom.srv.aps.bean.vo.usermessage.UserMessageListResVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.poi.ss.formula.functions.T;

@Mapper
public interface UserMessageMapper extends SyMapper<UserMessage> {

    @Select(" select um.status, m.id, m.app_name, m.title, m.summary, m.scope, m.icon, m.type, m.link_url, m.user_code, m.start_date_time, m.end_date_time " +
            " from tb_base_message m " +
            " left join tb_base_user_message um on um.user_code = m.user_code and m.id = um.message_id " +
            " ${ew.customSqlSegment} ")
    Page<UserMessageListResVo> findByUserNotRead(@Param(Constants.WRAPPER) QueryWrapper<?> query, Page<T> page);

}
